package cn.silver.module.system.enums;

import cn.silver.framework.core.model.DictModel;
import cn.silver.framework.core.utils.StreamUtils;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;

@Getter
@AllArgsConstructor
public enum UserSexEnums {

    /**
     * 男
     */
    MALE("00", "男"),
    /**
     * 女
     */
    FEMALE("10", "女"),
    OTHNER("99", "未知"),
    ;

    private String code;
    private String name;

    public static List<DictModel> getModels() {
        return StreamUtils.toList(Arrays.asList(values()), item -> new DictModel(item.name, item.code));
    }

}
